/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.qihoo.gamecenter.sdk.pay.component;

import android.content.Context;
import android.text.TextUtils;
import android.util.Pair;
import android.util.SparseArray;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.TextView;
import com.qihoo.gamecenter.sdk.common.i.s;
import com.qihoo.gamecenter.sdk.pay.b.a;
import com.qihoo.gamecenter.sdk.pay.res.b;

public class PayBankGridView extends LinearLayout implements PaySelectorGrid.a {
    private int a;
    private boolean b;
    private String c = "";
    private TextView d;
    private b e;
    private PaySelectorGrid f;
    private SparseArray g;

    public PayBankGridView(Context paramContext) {
        super(paramContext);
        this.e = b.a(paramContext);
        this.b = false;
        this.a = s.b(getContext(), 5.0F);
        setOrientation(1);
    }

    public void a(int paramInt) {
        LinearLayout.LayoutParams localLayoutParams = new LinearLayout.LayoutParams(-1, -2);
        this.d = new TextView(getContext());
        this.d.setLayoutParams(localLayoutParams);
        this.d.setTextColor(-10066330);
        this.d.setTextSize(1, s.a(getContext(), 13.3F));
        this.d.setLineSpacing(s.b(getContext(), 4.0F), 1.0F);
        this.d.setVisibility(8);
        addView(this.d);
        localLayoutParams = new LinearLayout.LayoutParams(-1, -2);
        this.f = new PaySelectorGrid(getContext());
        this.f.setLayoutParams(localLayoutParams);
        this.f.setItemPadding(4);
        this.f.a(this);
        this.f.setSeparatorLineColor(0);
        this.f.setSeparatorLineSize(s.b(getContext(), 8.0F));
        this.f.b((paramInt == 65281) ? 3 : 4);
        addView(this.f);
    }

    public void a(String paramString) {
        this.c = new String(paramString);
    }

    public boolean b(String paramString) {
        return (!(this.c.equalsIgnoreCase(paramString)));
    }

    public void setBankClickable(boolean paramBoolean) {
        this.b = paramBoolean;
    }

    public void a() {
        if (this.f == null)
            return;
        this.f.a();
    }

    public void setSeparatorLineSize(int paramInt) {
        this.f.setSeparatorLineSize(paramInt);
    }

    public void setExplain(CharSequence paramCharSequence) {
        if (TextUtils.isEmpty(paramCharSequence)) {
            this.d.setVisibility(8);
        }
        else {
            this.d.setVisibility(0);
            this.d.setText(paramCharSequence);
        }
    }

    public void setExplainTextSize(float paramFloat) {
        if (paramFloat <= 0.0F)
            paramFloat = s.a(getContext(), 13.3F);
        this.d.setTextSize(1, paramFloat);
    }

    public void setExplainTextColor(int paramInt) {
        this.d.setTextColor(paramInt);
    }

    public boolean a(String[] paramArrayOfString) {
        if ((paramArrayOfString == null) || (paramArrayOfString.length <= 0))
            return false;
        if (this.g != null)
            this.g.clear();
        this.g = new SparseArray(paramArrayOfString.length);
        String[] arrayOfString2 = new String[paramArrayOfString.length];
        for (int i = 0; i < paramArrayOfString.length; ++i) {
            if (TextUtils.isEmpty(paramArrayOfString[i]))
                continue;
            String[] arrayOfString1 = paramArrayOfString[i].split("~");
            if ((arrayOfString1 == null) || (arrayOfString1.length < 2))
                continue;
            this.g.append(i, arrayOfString1[0]);
            arrayOfString2[i] = arrayOfString1[1];
        }
        if (arrayOfString2.length <= 0)
            return false;
        this.f.a(arrayOfString2);
        return true;
    }

    public void setPITLeftMargin(int paramInt) {
        this.a = paramInt;
    }

    public View a(View paramView, String paramString, int paramInt) {
        PayImgTextView localPayImgTextView;
        if (paramView instanceof PayImgTextView) {
            localPayImgTextView = (PayImgTextView) paramView;
        }
        else {
            localPayImgTextView = new PayImgTextView(getContext());
            localPayImgTextView.a(65282);
            localPayImgTextView.setSingleLine();
            localPayImgTextView.setTextColor(-16777216);
            this.e.a(localPayImgTextView, -1073741798);
            localPayImgTextView.setTextSize(1, s.a(getContext(), 12.0F));
        }
        localPayImgTextView.setText(paramString);
        localPayImgTextView.setImageDrawable(a.a(getContext(), (String) this.g.get(paramInt)),
                s.b(getContext(), 16.0F), s.b(getContext(), 16.0F));
        localPayImgTextView.setImageMargin(this.a, new int[0]);
        return localPayImgTextView;
    }

    public boolean b(View paramView, String paramString, int paramInt) {
        if (this.b)
            this.e.a(paramView, -1073741797);
        return false;
    }

    public boolean c(View paramView, String paramString, int paramInt) {
        this.e.a(paramView, -1073741798);
        return false;
    }

    public Pair b() {
        return null;
    }

    public View c() {
        return null;
    }
}